package com.wit.witmg.api;


import com.wit.witmg.entity.TPAdata;
import com.wit.witmg.service.ITPAdataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author bob
 * @since 2025-04-28
 */
@RestController
@RequestMapping("padata")
@Api(tags = "粒度分析API")
public class TPAdataController {

    @Resource
    private ITPAdataService service;

    @ApiOperation("添加")
    @PostMapping("add")
    public Object add(HttpServletRequest request,
                      @RequestBody String json) {
        return service.add(request,json);
    }

    @ApiOperation("获取")
    @PostMapping("get")
    public Object get(HttpServletRequest request,
                      @RequestParam(value = "bh",required = false) String bh,//编号
                      @RequestParam(value = "ph",required = false) String ph) {//批号
        return service.get(request,bh,ph);
    }

}
